// pages/agents/index.js
const app = getApp()

Page({

    /**
     * 页面的初始数据
     */
    data: {
        imagesrc: 'https://aiw.oss-cn-beijing.aliyuncs.com/year/Group17.png',
        logosrc:'https://aiw.oss-cn-beijing.aliyuncs.com/AiLogo.png',
        aitext:'../../images/aizhinengtuan.png',
        agentId: 0
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        // 给页面设置个默认的代理id,平台自身
        if (options.agentId == undefined) options.agentId = 1;
        if (options.agentId !== undefined && options.agentId > 0) {
            wx.setStorageSync('agentId', options.agentId);
            this.setData({
                agentId: options.agentId
            })            
        }       
    },
    handleClick() {
        console.log('debug::agentId::', wx.getStorageSync('agentId')); 
        wx.navigateTo({
            // url: '/pages/newDetail/indexV2?type=1-1-5&cid3=19',
            url: '/pages/indexAgent/index?agentId='+this.data.agentId,
        })         
    }
})
